from django import forms

from apps.models import Topic, Post


class NewTopicForm(forms.ModelForm):
    message = forms.CharField(
        widget=forms.Textarea(
            attrs={ 'rows': 5, 'placeholder': 'Enter your message' }
        ),
        max_length=4000,
        help_text='The max length of the message is 4000 characters.'
    )

    class Meta:
        model = Topic
        fields = ['subject', 'message']



class PostForm(forms.ModelForm):
    class Meta:
        model = Post
        fields = ['message',]
